package com.gonsin.gmessage.logic.websocket;

import java.io.Serializable;

public class Client implements Serializable {

    private static final long serialVersionUID = 8957107006902627635L;

    private String userName;

    private String sessionId;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Client(String userName, String sessionId) {
        this.userName = userName;
        this.sessionId = sessionId;
    }

    public Client() {
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    @Override
    public boolean equals(Object o) {
        if(o == null){
            return false;
        }
        if(!(o instanceof Client)){
            return false;
        }
        return ((Client) o).getSessionId().equals(sessionId);
    }
}
